<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
<div id="app">
	<router-link to="/login?id=10">登陆</router-link>
	<router-link to="/register?id=12" tag="span">注册</router-link>
	<router-view></router-view>
</div>
<script src="node_modules/vue/dist/vue.js"></script>
<script src="node_modules/vue-router/dist/vue-router.js"></script>
<script>
	var login = {
		template : '<h1>登陆组件-----{{ $route.fullPath }}-------{{ $route.query.id }}</h1>',
		data(){
			return {}
		},
		created(){
			// 组件的生命周期钩子函数
			console.log(this.$route.query.id)
		}
	}
	var register = {
		template : '<h1>注册组件-----{{ $route.fullPath }}-------{{ $route.query.id }}</h1>'
	}
	var router = new VueRouter({
		routes : [
			{ path : '/login', component : login},
			{ path : '/register', component : register}
		]
	})
	var vm = new Vue({
		el:'#app',
		data:{},
		router
	})
</script>
</body>
</html>